package com.tang.framework.core.domain

import com.alibaba.excel.annotation.ExcelIgnore
import com.baomidou.mybatisplus.annotation.*
import com.baomidou.mybatisplus.extension.activerecord.Model
import com.fasterxml.jackson.annotation.JsonFormat
import lombok.Data
import lombok.EqualsAndHashCode
import java.time.LocalDateTime

@Suppress("FINITE_BOUNDS_VIOLATION_IN_JAVA")
@EqualsAndHashCode(callSuper = true)
@Data
open class BaseEntity<T :Model<T>>(
        @TableId(type = IdType.ASSIGN_ID)
        @ExcelIgnore
        var id: Long? = null,
        @TableField(value = "`create_time`", fill = FieldFill.INSERT)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @ExcelIgnore
        var createTime: LocalDateTime? = null,
        @TableField(value = "`update_time`", fill = FieldFill.UPDATE)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @ExcelIgnore
        var updateTime: LocalDateTime? = null,
        @TableLogic
        @TableField(value = "`del_flag`")
        @ExcelIgnore
        var delFlag :String? = "0",
        @TableField(value = "`tenant_id`")
        @ExcelIgnore
        var tenantId: String? = null
        ) : Model<T>()
